<?php


namespace App\Http\Controllers;


use App\Http\Requests\PaymentRequest;
use App\Services\PosApi\Payment;
use D1M\Common\Helpers\Result;

class PaymentController
{
    public function getResult(PaymentRequest $request,Payment $service)
    {
        $id = $request->post('data')['id'];
        $result = $service->getResult($id);
        return $result['error'] ? Result::fail($result['message']) : Result::success($result['data']);
    }
}